﻿<%@ Page Title="Nová stránka" Language="C#" MasterPageFile="~/Pages/Site.Master" AutoEventWireup="true" CodeBehind="PageNew.aspx.cs" Inherits="Altairis.FluffyCloud.WebCore.Pages.Sewen.PageNew" %>
<asp:Content ContentPlaceHolderID="Main" runat="server">
    <div id="pagebox">
        <h1 id="title">Vytvořit novou stránku</h1>
        <asp:FormView ID="PageFormView" runat="server" DataSourceID="PageObjectDataSource" RenderOuterTable="false" DefaultMode="Insert" OnItemCommand="PageFormView_ItemCommand" OnItemInserted="PageFormView_ItemInserted">
            <InsertItemTemplate>
                <div class="form">
                    <p>
                        <asp:Label runat="server" Text="Název:" AssociatedControlID="TitleTextBox" />
                        <asp:RequiredFieldValidator runat="server" ControlToValidate="TitleTextBox" ErrorMessage="Není zadán název" Display="Dynamic" Text="*" />
                        <br />
                        <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                    </p>
                    <p>
                        <asp:Label runat="server" Text="Text stránky:" AssociatedControlID="BodyTextBoxHtml" />
                        <asp:RequiredFieldValidator runat="server" ControlToValidate="BodyTextBoxHtml" ErrorMessage="Není zadán text stránky" Display="Dynamic" Text="*" />
                        <br />
                        <asp:TextBox ID="BodyTextBoxHtml" runat="server" Text='<%# Bind("Body") %>' TextMode="MultiLine" Height="300px" data-exteditortype="wikimarkup" />
                    </p>
                    <asp:ValidationSummary runat="server" />
                    <p class="buttons">
                        <asp:Button ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Odeslat" />
                        <asp:Button ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Storno" />
                    </p>
                </div>
            </InsertItemTemplate>
        </asp:FormView>
        <asp:ObjectDataSource ID="PageObjectDataSource" runat="server" TypeName="Altairis.Sewen.PageStoreManager" DataObjectTypeName="Altairis.Sewen.SewenPage" InsertMethod="SavePage" />
    </div>
</asp:Content>